package GameMain.UIControl
{
	import Engine.UIControl.IconBase;
	
	import flash.display.BitmapData;
	import flash.display.Sprite;
	
	public class ItemIcon extends IconBase
	{
		private static var defaultIcon:BitmapData = null;
		
		private var _itemID:int;
		private var _itemIndex:int;
		
		public static function setDefaultIcon(_class:Class):void
		{
			defaultIcon = new _class as BitmapData;
		}
		
		public function ItemIcon(p_index:int, p_width:Number=42, p_height:Number=42)
		{
			super(null, p_width, p_height);
			this._itemID = 0;
			this._itemIndex = p_index;
			this.setIconBMP(defaultIcon);
			this.setDrag(true);
			this._setClickFun(this.onClickItem);
		}	
		
		public function onClickItem():void
		{
			trace(this._itemIndex);
		}
		
	}
}